package io.github.hadyang.leetcode.random;

/**
 * @author haoyang.shi
 * @date 2019-10-20
 */
public class Node {
  public int val;
  public Node next;
  public Node random;

  public Node() {}

  public Node(int _val, Node _next, Node _random) {
    val = _val;
    next = _next;
    random = _random;
  }

  @Override
  public String toString() {
    return "{\"Node\":{"
        + "\"val\":\""
        + val
        + "\""
        + ", \"next\":"
        + (next == null ? "NULL" : next.hashCode())
        + ", \"random\":"
        + (random == null ? "NULL" : random.hashCode())
        + "}}";
  }
}
